/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is Forte for Java, Community Edition. The Initial
* Developer of the Original Code is Sun Microsystems, Inc. Portions
* Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.web.core.jswdk;
/**
*
* @author Ian Formanek
*/
public class MapEditPanel extends javax.swing.JPanel {
static final long serialVersionUID =7509134653234834239L;
/** Creates new form KeyBindingEditPanel */
public MapEditPanel(String firstText, String secondText) {
initComponents ();
actionLabel.setText(firstText);
keyLabel.setText(secondText);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {//GEN-BEGIN:initComponents
actionLabel = new javax.swing.JLabel ();
actionComboBox = new javax.swing.JComboBox ();
keyLabel = new javax.swing.JLabel ();
keyTextField = new javax.swing.JTextField ();
setLayout (new java.awt.GridBagLayout ());
java.awt.GridBagConstraints gridBagConstraints1;
actionLabel.setText (org.openide.util.NbBundle.getBundle(MapEditPanel.class).getString("CTL_MapEditPanel.actionLabel.text"));
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.insets = new java.awt.Insets (0, 0, 0, 8);
gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
add (actionLabel, gridBagConstraints1);
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.gridwidth = 0;
gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints1.insets = new java.awt.Insets (0, 0, 8, 0);
gridBagConstraints1.weightx = 1.0;
add (actionComboBox, gridBagConstraints1);
keyLabel.setText (org.openide.util.NbBundle.getBundle(MapEditPanel.class).getString("CTL_MapEditPanel.keyLabel.text"));
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.insets = new java.awt.Insets (0, 0, 0, 8);
gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
add (keyLabel, gridBagConstraints1);
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.gridwidth = 0;
gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints1.weightx = 1.0;
add (keyTextField, gridBagConstraints1);
}//GEN-END:initComponents
void setTexts(String[][] prefil, int selidx) {
actionComboBox.setEditable(true);
String[] offer = prefil[0];
for (int i = 0; i < offer.length; i++) {
actionComboBox.addItem(offer[i]);
}
String txt = prefil[1][0];
keyTextField.setText(txt);
if (selidx >= 0) {
actionComboBox.setSelectedIndex(selidx);
} else {
actionComboBox.addItem(""); // NOI18N
actionComboBox.setSelectedIndex(offer.length);
}
}
String[] getTexts() {
String[] ret = new String[2];
ret[0] = (String) actionComboBox.getSelectedItem();
ret[1] = keyTextField.getText();
return ret;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel actionLabel;
private javax.swing.JComboBox actionComboBox;
private javax.swing.JLabel keyLabel;
private javax.swing.JTextField keyTextField;
// End of variables declaration//GEN-END:variables
}
/*
* Log
* 3 Gandalf 1.2 1/13/00 Petr Jiricka More i18n
* 2 Gandalf 1.1 10/23/99 Ian Formanek NO SEMANTIC CHANGE - Sun
* Microsystems Copyright in File Comment
* 1 Gandalf 1.0 10/7/99 Petr Jiricka
* $
*/